<?php
namespace Home\Controller;
use Home\Controller\IndexController;
class AnalysisController extends IndexController {

    public function analysisContribute() {
        //取出年份
        $dModel = M('Dictionary');
        $yData = $dModel->field('value')->where(array(
                    'category' => array('eq', '年份'),
                    'var' => array('neq', '')
                ))->select();
        $this->assign('yData', $yData);

        $model = D('order');
        $data = $model->analysisContribute();
        $this->assign(array(
            'data' => $data['data'],
            'page' => $data['page'],
        ));

        $this->display();
    }

    public function analysisCompose() {

        $model = D('Client');
        $data = $model->analysisCompose();
        $this->assign(array(
            'data' => $data['data'],
            'name' => $data['name'],
        ));
        $this->display();
    }

    public function analysisServe() {

        //取出年份
        $dModel = M('Dictionary');
        $yData = $dModel->field('value')->where(array(
                    'category' => array('eq', '年份'),
                    'var' => array('neq', '')
                ))->select();
        $this->assign('yData', $yData);

        $model = D('Serive');
        $data = $model->analysisServe();
        $this->assign(array(
            'data' => $data['data'],
            'page' => $data['page'],
        ));
        $this->display();
    }

    public function analysisRun() {

        $model = D('Run');
        $data = $model->search(1);
        $this->assign(array(
            'data' => $data['data'],
            'page' => $data['page'],
        ));
        //var_dump($data);
        $this->display();
    }

}
